﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Weka
{
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class MessageIdAttribute : Attribute
    {
        internal byte Id { private set; get; }
        public MessageIdAttribute(byte messageId) { Id = messageId; }
    }


    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false)]
    public class FieldAttribute : Attribute
    {
        internal byte Id { private set; get; }
        internal short Ordinal { private set; get; }
        internal object DefaultValue { private set; get; }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="fieldId">Max size 95.</param>
        public FieldAttribute(byte fieldId, short ordinal)
        {
            if (fieldId > 95) throw new Exception(fieldId.ToString() + " is too large for a FieldId.");
            Id = fieldId;
            Ordinal = ordinal;
        }

        public FieldAttribute(byte fieldId) : this(fieldId, 0) { }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="fieldId">Max size 95.</param>
        /*        public FieldAttribute(byte fieldId, short ordinal, object defaultValue)
                {
                    if (fieldId > 95) throw new Exception(fieldId.ToString() + " is too large for a FieldId.");
                    Id = fieldId;
                    Ordinal = ordinal;
                    DefaultValue = defaultValue;
                }
        */
    }
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
    public class MissingValueSetterAttribute : Attribute { }
}
